package demo;

import java.io.File;
import java.io.IOException;

public class FileOperator {
    public static void main(String[] args) {
        File f = new File("E:" + File.separator + "hello.txt");
        try {
            boolean result = f.createNewFile(); // 原地创建文件
            if (!result) {
                System.out.println("文件创建失败");
            }
        } catch (IOException e) {
            System.out.println("文件创建失败");
        }
    }
}
